/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ats.ereg.model.entities;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Ali
 */
@Entity
@Table(name = "tst_users")
@NamedQueries({
    @NamedQuery(name = "TstUsers.findAll", query = "SELECT t FROM TstUsers t")})
public class TstUsers implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    private Integer id;
    @Basic(optional = false)
    private String name;
    @Basic(optional = false)
    private String username;
    @Basic(optional = false)
    private String password;
    @Column(name = "create_date")
    @Temporal(TemporalType.TIMESTAMP)
    private Date createDate;
    @Column(name = "update_date")
    @Temporal(TemporalType.TIMESTAMP)
    private Date updateDate;
    @Column(name = "created_by")
    private Integer createdBy;
    @Column(name = "updated_by")
    private Integer updatedBy;
    @OneToMany(mappedBy = "updatedBy")
    private List<TstStudents> tstStudentsList;
    @OneToMany(mappedBy = "createdBy")
    private List<TstStudents> tstStudentsList1;

    public TstUsers() {
    }

    public TstUsers(Integer id) {
        this.id = id;
    }

    public TstUsers(Integer id, String name, String username, String password) {
        this.id = id;
        this.name = name;
        this.username = username;
        this.password = password;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public Integer getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(Integer createdBy) {
        this.createdBy = createdBy;
    }

    public Integer getUpdatedBy() {
        return updatedBy;
    }

    public void setUpdatedBy(Integer updatedBy) {
        this.updatedBy = updatedBy;
    }

    public List<TstStudents> getTstStudentsList() {
        return tstStudentsList;
    }

    public void setTstStudentsList(List<TstStudents> tstStudentsList) {
        this.tstStudentsList = tstStudentsList;
    }

    public List<TstStudents> getTstStudentsList1() {
        return tstStudentsList1;
    }

    public void setTstStudentsList1(List<TstStudents> tstStudentsList1) {
        this.tstStudentsList1 = tstStudentsList1;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TstUsers)) {
            return false;
        }
        TstUsers other = (TstUsers) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.ats.ereg.model.entities.TstUsers[ id=" + id + " ]";
    }
    
}
